let morgan = function (req, res, next) {
    let morgan = require('morgan');   //logger
    let fs = require('fs');
    let path = require('path');
    let logStream = fs.createWriteStream(path.join(__dirname, '../logs/morgan.log'), { flags: 'a' });

    return morgan('combined', { stream: logStream, immediate: true })(req, res, next);
};


exports = module.exports = morgan;